package a12_JVM;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author quan
 * @Description 堆异常：OOM异常
 * @Date 2023/7/21 17:50
 */
public class Demo1_OOM {
    static class OOMObject{}
    public static void main(String[] args) {
        List<OOMObject> list = new ArrayList<>();
        //不断new对象放入list中,堆中的内存区域就会被占满
        while (true){
            list.add(new OOMObject());
        }
    }
}
